package pl.vanta.mjuzik2.api;

import java.util.Comparator;


public class AudioFileComparator implements Comparator<AudioFile>
{
	@Override
	public int compare(AudioFile af1, AudioFile af2)
	{
		int result = 0;

		result = af1.getFile().getParent().compareToIgnoreCase(af2.getFile().getParent());

		if (result == 0)
		{
			result = af1.getFile().getName().compareToIgnoreCase(af2.getFile().getName());
		}

		return result;
	}
}